
import { createApp } from 'vue'
import App from '@/App.vue'
import router from '@/router'
import "@/assets/css/init.css"
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/assets/QWeather-Icons-1.3.1/font/qweather-icons.css'
import pinia from "@/store/store"
import { ElLoading } from 'element-plus';
import { useIndexStore } from '@/store/model';
import '@/utils/index.js'
import WebTracing from '@web-tracing/vue3'

(async () => {
    const store = useIndexStore()
    await store.update_web_url()
    await store.update_user_info_init()
    let app = createApp(App)
    app.use(pinia)
    app.use(router)
    app.use(ElementPlus)
    app.use(WebTracing, {
        dsn: `${store.web_url.webPath}/upload_logs`,
        appName: 'my_blog',
        debug:true,
        userUuid:store.user_info.user_id,
        pv: false,
        performance: false,
        error: true,
        event: false,
        cacheMaxLength: 2,
        cacheWatingTime: 1000,
        scopeError:true,
        beforeSendData:(data)=>{
            let eventInfo = data.eventInfo.filter((item)=>{
                if(item.errMessage){
                    return true
                }else{
                    return false
                }
            })
            if(eventInfo.length === 0){
                return false
            }
            data.eventInfo = eventInfo
            return data
        }
    })
    app.mount('#app')
})()












